package com.whalefin.service;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by bethinner on 2015/5/18.
 */
public class test {

    public static void main (String args[]){
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try
        {
            Date d1 = df.parse("2004-01-22 11:15:24");
            Date d2 = df.parse("2004-01-02 11:00:00");
            long l=d1.getTime()-d2.getTime();
            long day=l/(24*60*60*1000);
            long hour=(l/(60*60*1000)-day*24);
            long min=((l/(60*1000))-day*24*60-hour*60);
            System.out.println(min+"分");
            System.out.println(day+"天");
            System.out.println(hour+"时");

        }
        catch (Exception e)
        {
        }




    }
}
